
const ua = navigator.userAgent;
export function platform(){
    let p = {};
    if(/iPhone/ig.test(ua)){
        p.isIphone = true;
    }
    if(/iPad/ig.test(ua)){
        p.isIpad = true
    }
    if(/iPod/ig.test(ua)){
        p.isIpod = true
    }
    if(/iPhone|iPad|iPod/ig.test(ua) && !window.MSStream){
        p.isIos = true
    }
    if(/MicroMessenger/ig.test(ua)){
        p.isWeixin = true
    }
    return p;
}

export function client(){
    let client;
    let p = platform()
    if(p.isIphone){
        client = 'iphone'
    }
    if(p.isIpad){
        client = 'ipad'
    }
    if(p.isIpod){
        client = 'ipod'
    }
    if(p.isAndroid){
        client = 'android'
    }
    if(p.isWeixin){
        client = 'weixin'
    }else{
        client = 'web'
        if(/Chrome/ig.test(ua)){
            client = 'chrome'
        }
        if(/safari/ig.test(ua)){
            client = 'safari'
        }
        if(/msie/ig.test(ua)){
            client = 'msie'
        }
    }
    return client;
}

export function version(){

}
